package com.net.test.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.net.test.db.MybatisDAO;
import com.net.test.vo.TVO;

@Service
public class TService {
	
	public int insertData1(String id, TVO obj) throws Exception{
		MybatisDAO mybatisDAO = new MybatisDAO();
		int result= 0;
		
		result = mybatisDAO.insertData1(id, obj);
		
		return result;
	}
	public Object getViewDataOne(String id, TVO check) throws Exception{
		MybatisDAO mybatisDAO = new MybatisDAO();
		Object lists = null;
		
		lists = mybatisDAO.getViewDataOne(id, check);
		
		return lists;
	}
	public Object getViewDataOne2(String id, TVO value) throws Exception{
		MybatisDAO mybatisDAO = new MybatisDAO();
		Object lists = null;
		
		lists = mybatisDAO.getViewDataOne2(id, value);
		
		return lists;
	}
	
	public Object selectList(String id) throws Exception {
		Object lists = null;
		MybatisDAO mybatisDAO = new MybatisDAO();
		lists = mybatisDAO.getListData(id);
		
		return lists;
	}
	public Object selectList1(String id, TVO value)throws Exception{
		Object lists = null;
		MybatisDAO mybatisDAO = new MybatisDAO();
		lists = mybatisDAO.getListData1(id, value);
		
		return lists;
		
	}
	public Object ViewData(String id, TVO check1) throws Exception{
		Object lists = null;
		MybatisDAO mybatisDAO = new MybatisDAO();
		lists = mybatisDAO.getViewData1(id, check1);
		
		return lists;
	}
	 public int updateData2(String id, TVO obj) throws Exception{
		 int result =0;
		 MybatisDAO mybatisDAO = new MybatisDAO();
		 result = mybatisDAO.updateData2(id, obj);
		 
		 return result;
	 }
	 public int deleteData1(String id, TVO obj) throws Exception{
		 int result =0;
		 MybatisDAO mybatisDAO = new MybatisDAO();
		 result = mybatisDAO.deleteData1(id, obj);
		 
		 return result;
	 }
	 public int updateData3(String id, TVO obj) throws Exception{
		 int result = 0;
		 MybatisDAO mybatisDAO = new MybatisDAO();
		 result = mybatisDAO.updateData3(id, obj);
		 
		 return result;
	 }
	public int m_board_total_cnt(String id, Object value) throws Exception{
		// TODO Auto-generated method stub
		 int result = 0;
		 MybatisDAO mybatisDAO = new MybatisDAO();
		 result = (Integer)mybatisDAO.getViewDataOne(id, value);
		 
		 return result;
	}
	public Object m_board_list(String id, Object value) throws Exception{
		Object lists = null;
		MybatisDAO mybatisDAO = new MybatisDAO();
		lists = mybatisDAO.getListData(id, value);
		
		return lists;
	}
	public Integer hitCount(String id, TVO obj) throws Exception{
		// TODO Auto-generated method stub
		 int result =0;
		 MybatisDAO mybatisDAO = new MybatisDAO();
		 result = mybatisDAO.updateData(id, obj);
		 
		return result;
	}
	public Integer likeCount(String id, TVO obj) throws Exception{
		// TODO Auto-generated method stub
		int result =0;
		MybatisDAO mybatisDAO = new MybatisDAO();
		result = mybatisDAO.updateData(id, obj);
		
		return result;
	}
	
}
